package emblem.chat.client;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;

import javax.swing.JPanel;
import javax.swing.JTextField;

import org.jdesktop.application.SingleFrameApplication;

/**
 * 
 */
public class ClientWindow extends SingleFrameApplication {
    private JPanel topPanel;
    private JButton btnLogin;
    private JLabel jLabel2;
    private JTextField txtPassword;
    private JTextField txtUserId;
    private JLabel jLabel1;
    private JButton btnQuit;

    private IStatusCallBack loginCallback=new IStatusCallBack() {
		
		public void callBackFun() {
			
		}
	};
    
    private StatusMachine sm=new StatusMachine();
    
    @Override
    protected void startup() {
        topPanel = new JPanel();
        topPanel.setPreferredSize(new java.awt.Dimension(332, 185));
        topPanel.setLayout(null);
        {
        	btnLogin = new JButton();
        	topPanel.add(btnLogin);
        	btnLogin.setName("btnLogin");
        	btnLogin.setBounds(55, 128, 57, 23);
        	btnLogin.addActionListener(new ActionListener() {
        		public void actionPerformed(ActionEvent evt) {
        			btnLoginActionPerformed(evt);
        		}
        	});
        }
        {
        	btnQuit = new JButton();
        	topPanel.add(btnQuit);
        	btnQuit.setBounds(159, 128, 57, 23);
        	btnQuit.setName("btnQuit");
        }
        {
        	jLabel1 = new JLabel();
        	topPanel.add(jLabel1);
        	jLabel1.setBounds(55, 36, 56, 15);
        	jLabel1.setName("jLabel1");
        }
        {
        	txtUserId = new JTextField();
        	topPanel.add(txtUserId);
        	txtUserId.setBounds(103, 34, 113, 20);
        }
        {
        	jLabel2 = new JLabel();
        	topPanel.add(jLabel2);
        	jLabel2.setBounds(55, 79, 48, 15);
        	jLabel2.setName("jLabel2");
        }
        {
        	txtPassword = new JTextField();
        	topPanel.add(txtPassword);
        	txtPassword.setBounds(103, 77, 113, 20);
        }
        show(topPanel);
    }

    public static void main(String[] args) {
        launch(ClientWindow.class, args);
    }
    
    
    
    public void btnLoginActionPerformed(ActionEvent evt) {
    	System.out.println("btnLogin.actionPerformed, event="+evt);
    	//TODO add your code for btnLogin.actionPerformed
    }

}
